# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=py3-cvxpy
pkgver=1.2.1
pkgrel=4
pkgdesc="a Python-embedded modeling language for convex optimization problems"
url="https://github.com/cvxpy/cvxpy"
arch="all"
license="Apache-2.0"
depends="python3 py3-numpy py3-scipy py3-toolz py3-ecos py3-scs"
makedepends="py3-setuptools py3-numpy-dev python3-dev"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="cvxpy-$pkgver.tar.gz::https://github.com/cvxpy/cvxpy/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/cvxpy-$pkgver"
options="!check"

case "$CARCH" in
	x86|armv7|armhf);;
	*) depends="$depends py3-osqp";;
esac

build() {
	python3 setup.py build
}

check() {
	pytest
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
faf07c94cb3361eb196ba05d77733b1be3086046252097e272d4f0b4694907974b026328f9d6e82884fbd81917cd0535f1c466de1d325c5bb6026694c9ff7ee4  cvxpy-1.2.1.tar.gz
"
